const { ccclass, property } = cc._decorator;

import Utils = require("../../utils/Utils");
import RepairBaseView from "./RepairBaseView";
import UIHelper = require("../../component/UIHelper");

@ccclass
export default class RepairPersonThreeView extends RepairBaseView {

    _Step = ["shou","niezi","yaogao","shabu"];//关卡标识 用于icon名字 拼接
    _StepList = [1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4];//11个步骤
    _StepNum = 4;//4关
    _guidePos = [
        cc.v2(-25,-175),cc.v2(3,-181),cc.v2(-25,-175),cc.v2(-46,-181),cc.v2(-55,-296),
        cc.v2(18,-296),cc.v2(-63,-342),cc.v2(35,-335),cc.v2(-23,-329),cc.v2(-25,-184),cc.v2(-25,-175)
    ];

    start(){
        super.start();
        this.aniSpine.setCompleteListener(() => {
            this.showGuide();
        });
        this.aniSpine.setAnimation(0, "000", false);
    };

    playSound(){
        let str = this._point >= 10 ? "0" : "00";
        let name = str + this._point
        Utils.audioManager.playSound("huazhuang/mini/person/step3/" + name);
    };
    
    makeDot(){
    };

    onClickEnd(isSkip) {
        let next = this.params.next && this.params.next.shift();
        if (next) {
            UIHelper.openUI(next, {
                next: this.params.next
            })
            this.node.destroy();
        }
    }
}
